{% extends "base.html" %}
{% load blog_extras links_extras prefab_tags  %}
{% load blog_calendar %}
{% load cache i18n      %}
{% block pagetitle %}{{block.super|safe}}{% endblock pagetitle %}
{% block page-container %}
<div class="page-container">
    <div class="header">
        <div class="header-top">      
			<a class="sitelogo2" title="inici" href="{% setting 'BLOG_ROOT' %}"></a>
            <div class="sitename">
                <h1>
                    <a href="{% setting 'BLOG_ROOT' %}">{% setting 'BLOG_NAME' %}</a>   
                </h1>
                <h2>{% setting 'BLOG_SUBTITLE' %}</h2>
            </div>
            <div class="nav0"></div>
            <div class="nav1"></div>       
        </div>
        <!--<div class="header-middle"></div>-->
        <div class="header-bottom">
            <div class="nav2">
                {% cache 500  blog_roll %}
                {% get_blogroll as blogs %}
                {% if blogs %}
                <ul><li><a href="/">{% trans "Index" %}</a></li><li><a href="#">{% trans "De visita obligada" %}</a>
                        <ul>
                            {% for blog in blogs %}
                            <li><a href="{{blog.url}}" title="{{blog.description}}">{{blog.name}}</a></li>
                            {% endfor%}
                        </ul>
                    </li>                    
                </ul>
                {% endif %}
                {% endcache %}
                <ul><li><a href="#">{% trans "Projectes" %}</a>
                    <ul>
                        <li><a href="http://code.google.com/p/trespams/" target="_blank">Trespams</a></li>
                        <li><a href="http://code.google.com/p/appfusedjango/" target="_blank">Appfusedjango</a></li>
                        <li><a href="http://code.google.com/p/bulas/" target="_blank">Bulas</a></li>
                    </ul>
                    </li>
                </ul>
                <ul><li><a href="#">{% trans "Administraci&oacute;" %}</a>
                        <ul>                            
                            {% if not user.is_authenticated %}
                            <li><a href="/admin/">{% trans "Login" %}</a></li>
                            {% else %}
                            <li><a href="/tools/entry/add">{% trans "Nou post" %}</a></li>
                            <li><a href="/tools/entry/">{% trans "Posts" %}</a></li>
                            <li><a href="/admin/logout/">{% trans "Logout" %} {{user.username}}</a></li>
                            {% endif %}
                        </ul>
                    </li>
                </ul>
                {% if user.is_authenticated %}
                <ul><li><a href="#">{{user.username}}</a></li></ul>
                {% endif %}
            </div> <!-- nav2 -->
        </div><!-- header-bottom -->
        <div class="header-breadcrumbs">
            {% include "blog/includes/blog_nav.html" %}
            <div class="searchform">
                {% block "blog_search" %}
                <form action="{% BLOG_ROOT %}search/" method="post">
                    <fieldset>
                        <input type="text" class="field" name="query" id="id_query" value="{% trans 'Cercar...' %}" size="20" onfocus="if (this.value == 'Cercar...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Cercar...';}" />
                        {% if request.session.search_error %}<span title="les paraules de la cerca han de ser d'almanco 4 caracters">{{request.session.search_error}}</span>{% endif %}
                        <input type="submit" value="{% trans 'Au!' %}"  title="Cercar" class="button"/>
                    </fieldset>
                </form>
                {% endblock %}
            </div> <!-- searchform -->
        </div><!-- header-breadcrumbs -->
    </div> <!-- header-->
    <div class="main">
        <div class="main-navigation">
            {% block recent %}
            <div class="round-border-topright"></div>
            <h1 class="first">Articles Recents</h1>
            <dl class="nav3-grid">
                {% include "blog/includes/recent_posts.html" %}
            </dl>
			<div class="nav3-grid">
				<div id="calendar_container">						
				{% if today %}		
				<p class="calendar_month">{{ today|date:"F Y" }}</p>
				{% post_calendar today %}
				{% else %}
				    {% if month %}
				        <p  class="calendar_month">{{ month|date:"F Y" }}</p>
				        {% post_calendar month %}
					{% else %}
					   {% if day %}
                        <p  class="calendar_month">{{ day|date:"F Y" }}</p>
                        {% post_calendar day %}
                        {% else %}
                          {% post_calendar today %}
                        {% endif %}
					{% endif %}					
				{% endif %}				
				</div>
			</div>			
            {% endblock recent %}
            {% get_links as links %}
            {% if links %}
            <h1>{% trans "Links destacats" %}</h1>
            <dl class="nav3-grid">
                {% for link in links %}
                <dt><a href="{{link.url}}" class='menu_content'>{{link.name}}</a></dt>
                {% endfor %}                
            </dl>
            {% endif %}            
            <h1>{% trans "Web 2.0" %}</h1>
            <h2>{% trans "Tags" %}</h2>
            <dl class="nav3-grid">
                {% block "taglist" %}{% endblock %}
            </dl>

            <h2>{% trans "Feeds" %}</h2>
            <dl class="nav3-grid">                
                <dd>
                    <a href="{% setting 'BLOG_ROOT' %}feeds/posts/" title="{% trans 'Darrers articles' %}">
                        <img src='{% setting 'MEDIA_URL' %}images/rss-button.gif' border='0' height='11' alt='rss'></img>
                        {% trans "Articles" %}
                    </a>
                </dd>
                <dd>
                    <a href="{% setting 'BLOG_ROOT' %}feeds/comments/" title="{% trans 'Darrers comentaris' %}">
                        <img src='{% setting 'MEDIA_URL' %}images/rss-button.gif' border='0' height='11' alt='rss'></img>
                        {% trans "Commentaris" %}
                    </a>
                </dd>
                <dd>&nbsp;</dd>
            </dl>
            {% cache 86400 archive_list %}
            {% get_yearly_archive as archive_list %}
            {% if archive_list %}
            <h1>{% trans "Historial" %}</h1>
            <dl class="nav3-grid">
                {% for d in archive_list %}
					{% ifchanged d.year %}
						{% if forloop.first %}  
							<!-- first one -->
							<dt><a href="javascript:animatedcollapse.toggle('year{{d.year}}')">{{d.year}}</a></dt>
						    <div id="year{{d.year}}">
                        {% else %}
							</div>
							<dt><a href="javascript:animatedcollapse.toggle('year{{d.year}}')">{{d.year}}</a></dt>
							<div id="year{{d.year}}">
                        {% endif %}
					{% endifchanged %}
                    <dt><a href="{% setting 'BLOG_ROOT' %}{{ d.year }}/{{ d|date:"m" }}/" class='menu_content'>&nbsp;&nbsp;{{ d|date:"M Y" }}</a></dt>
                    {% if foorloop.last %}
                 </div>
                    {% endif %}
                {% endfor %}                
            </dl>
            {% endif %}
            {% endcache %}
        </div> <!-- main navigation-->
        <div class="main-content">
            {% block "contentbody" %}
            {% endblock "contentbody" %}
        </div> <!--main content-->
    </div><!-- main -->
	{% block footer %}
    <div class="footer">
        <p>Copyright © 2007 Trespams.com | <a title="sota llicència creative commons" href="http://creativecommons.org/licenses/by/2.5/deed.ca">Llicència CC Attribution</a> |&nbsp;Hostejat a <a href="http://apsl.net" title="apsl"> APSL</a> </p>
		<p class="credits"><a href="http://code.google.com/p/blogmaker/" title="blogmaker">{% trans "Basat en Blogmaker"%}</a>|{% trans "Design by" %} <a title={% trans '"Designer Homepage"' %} href="http://www.1-2-3-4.info/">Wolfgang</a>  | {% trans 'Modicat per' %} <a title="Antoni aloy" href="http://trespams.com">aaloy</a> | Powered by <a title="Django" href="http://djangoproject.org">Django</a> | <a title="Validate XHTML code" href="http://validator.w3.org/check?uri=referer">XHTML 1.0</a> | <a title="Validate CSS code" href="http://jigsaw.w3.org/css-validator/">CSS 2.0</a></p>
    </div><!--footer-->
    {% endblock footer %}
</div> <!-- page container -->
{% endblock page-container %}
{% block syntaxhighlighter %}
<script language="javascript" type="text/javascript" src="/media/js/shjs/sh_main.min.js"></script>
<script language="javascript" type="text/javascript" src="/media/js/shjs/lang/sh_sql.min.js"></script>
<script language="javascript" type="text/javascript" src="/media/js/shjs/lang/sh_python.min.js"></script>
<script language="javascript" type="text/javascript" src="/media/js/shjs/lang/sh_java.min.js"></script>
<script language="javascript" type="text/javascript">
  window.onload = function() {
    sh_highlightDocument();
    }    
</script>
<script type="text/javascript">
	animatedcollapse.addDiv('year2008', 'fade=0,speed=400,group=year,hide=1,persist=1')
	animatedcollapse.addDiv('year2007', 'fade=0,speed=400,group=year,hide=1')
	animatedcollapse.addDiv('year2006', 'fade=0,speed=400,group=year,hide=1')  
	animatedcollapse.addDiv('year2005', 'fade=0,speed=400,group=year,hide=1')  
	animatedcollapse.addDiv('year2004', 'fade=0,speed=400,group=year,hide=1')  
    animatedcollapse.init()
</script>
{% endblock %}

